<html lang="en">

<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Java.lang综述 - bravo</title>
<link rel="shortcut icon" href="https://JoyZgq.github.io/favicon.ico">
<link href="https://cdn.jsdelivr.net/npm/remixicon@2.2.0/fonts/remixicon.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.7.2/animate.min.css">
<link rel="stylesheet" href="https://JoyZgq.github.io/media/css/tailwind.css">
<link rel="stylesheet" href="https://JoyZgq.github.io/styles/main.css">
<link rel="alternate" type="application/atom+xml" title="Java.lang综述 - bravo - Atom Feed" href="https://JoyZgq.github.io/atom.xml">


  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-164181119-1"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
  
    gtag('config', 'UA-164181119-1');
  </script>
    

  <meta name="description" content="
作用：提供对Java编程语言设计至关重要的类。 最重要的类是Object，它是类层次结构的根， 类 ，其实例表示运行时的类。通常，有必要将原始类型的值表示为对象。 该包装类Boolean ， Character ， Integer ， L..." />
  <meta property="og:title" content="Java.lang综述 - bravo">
  <meta property="og:description" content="
作用：提供对Java编程语言设计至关重要的类。 最重要的类是Object，它是类层次结构的根， 类 ，其实例表示运行时的类。通常，有必要将原始类型的值表示为对象。 该包装类Boolean ， Character ， Integer ， L..." />
  <meta property="og:type" content="articles">
  <meta property="og:url" content="https://JoyZgq.github.io/post/fXMc3StAj/" />
  <meta property="og:image" content="https://JoyZgq.github.io/post-images/fXMc3StAj.webp">
  <meta property="og:image:height" content="630">
  <meta property="og:image:width" content="1200">
  <meta name="twitter:title" content="Java.lang综述 - bravo">
  <meta name="twitter:description" content="
作用：提供对Java编程语言设计至关重要的类。 最重要的类是Object，它是类层次结构的根， 类 ，其实例表示运行时的类。通常，有必要将原始类型的值表示为对象。 该包装类Boolean ， Character ， Integer ， L...">
  <meta name="twitter:card" content="summary_large_image">
  <link rel="canonical" href="https://JoyZgq.github.io/post/fXMc3StAj/">

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css">
 
  
    <link rel="stylesheet" href="https://JoyZgq.github.io/media/css/prism-github.css">
  

  
</head>

<body>
  <div class="antialiased flex flex-col min-h-screen" id="app">
    <a href="https://JoyZgq.github.io" class="fixed top-0 left-0 mt-4 bg-black text-white dark:text-gray-700 dark:bg-yellow-50 dark:hover:bg-black dark:hover:text-white inline-flex p-2 pl-8 hover:text-gray-700 hover:bg-yellow-50 font-bold z-10 transition-fast animated fadeInLeft">
      bravo
    </a>
    <div class="max-w-4xl w-full mx-auto">
      <div class="shadow-box bg-white dark:bg-gray-600 rounded-lg pt-32 md:pt-64 px-4 md:px-8 pb-8 animated fadeIn mb-8">
        <h1 class="text-5xl font-semibold leading-normal pb-8 mb-8 border-b-8 border-gray-700">
          Java.lang综述
        </h1>
        
          <img src="https://JoyZgq.github.io/post-images/fXMc3StAj.webp" alt="Java.lang综述" class="block w-full mb-8">
        
        <div class="mb-8 flex flex-wrap">
          <div class="text-gray-400 text-sm mr-4">2019-04-04 · 12 min read</div>
          
            <a href="https://JoyZgq.github.io/tag/mfQ75zvRf/" class="text-gray-700 text-sm border-b-2 border-dotted border-gray-200 hover:border-gray-600 transition-all duration-100 inline-flex mr-2">
              <i class="ri-hashtag"></i>
              lang
            </a>
          
        </div>
        <div class="markdown mb-8" v-pre>
          <blockquote>
<p>作用：提供对Java编程语言设计至关重要的类。 最重要的类是<code>Object</code>，它是类层次结构的根， 类 ，其实例表示运行时的类。通常，有必要将原始类型的值表示为对象。 该包装类Boolean ， Character ， Integer ， Long ， Float和Double达到这个目的。 例如，类型为Double的对象包含一个类型为double的字段，以这样的方式表示该值，即对它的引用可以存储在引用类型的变量中。 这些类还提供了许多用于在原始值之间进行转换的方法，以及支持equals和hashCode等标准方法。 Void类是一个不可实例化的类，它包含对表示void类型的类对象的引用。Math类提供常用的数学函数，例如正弦，余弦和平方根。 这些类String ， StringBuffer和StringBuilder同样提供字符串常用的操作。类ClassLoader， Process ， ProcessBuilder ， Runtime ， SecurityManager和System提供了管理类的动态加载，创造外部进程中，主机环境查询，如一天中的时间，以及安全策略的执行“系统操作”。类Throwable包含throw语句可能抛出的对象。 子类Throwable表示错误和异常。</p>
</blockquote>
<h3 id="接口">接口🦅🦉🦇🐺</h3>
<table>
<thead>
<tr>
<th style="text-align:left">接口</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><a href="https://joyzgq.github.io/post/g6ejmC6VS/">Appendable</a></td>
<td style="text-align:left">可以附加 <code>char</code>序列和值的对象。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/AutoCloseable.html">AutoCloseable</a></td>
<td style="text-align:left">一个对象，可以保存资源（例如文件或套接字句柄），直到它被关闭。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/CharSequence.html">CharSequence</a></td>
<td style="text-align:left"><code>CharSequence</code>是 <code>char</code>值的可读序列。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Cloneable.html">Cloneable</a></td>
<td style="text-align:left">类实现 <code>Cloneable</code>接口，以向 <a href="https://www.apiref.com/java11-zh/java.base/java/lang/Object.html#clone()"><code>Object.clone()</code></a>方法指示该方法对该类的实例进行字段到字段的复制是合法的。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://joyzgq.github.io/post/jdk-souce-comparable/">Comparable</a><T></td>
<td style="text-align:left">此接口对实现它的每个类的对象强加一个总排序。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Iterable.html">Iterable</a><T></td>
<td style="text-align:left">实现此接口允许对象成为增强的 <code>for</code>语句的目标（有时称为“for-each loop”语句）。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ProcessHandle.html">ProcessHandle</a></td>
<td style="text-align:left">ProcessHandle识别并提供对本机进程的控制。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ProcessHandle.Info.html">ProcessHandle.Info</a></td>
<td style="text-align:left">有关流程的信息快照。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Readable.html">Readable</a></td>
<td style="text-align:left">A <code>Readable</code>是字符的来源。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Runnable.html">Runnable</a></td>
<td style="text-align:left"><code>Runnable</code>接口应由任何其实例由线程执行的类实现。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StackWalker.StackFrame.html">StackWalker.StackFrame</a></td>
<td style="text-align:left"><code>StackFrame</code>对象表示由<a href="https://www.apiref.com/java11-zh/java.base/java/lang/StackWalker.html"><code>StackWalker</code></a>返回的方法调用。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/System.Logger.html">System.Logger</a></td>
<td style="text-align:left"><code>System.Logger</code>实例记录将路由到<a href="https://www.apiref.com/java11-zh/java.base/java/lang/System.LoggerFinder.html"><code>LoggerFinder</code></a>使用的基础日志记录框架的<a href="https://www.apiref.com/java11-zh/java.base/java/lang/System.LoggerFinder.html">消息</a> 。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Thread.UncaughtExceptionHandler.html">Thread.UncaughtExceptionHandler</a></td>
<td style="text-align:left">当 <code>Thread</code>由于未捕获的异常而突然终止时调用的处理程序接口。</td>
</tr>
</tbody>
</table>
<h3 id="类摘要">类摘要🦁🙊🦆🐝</h3>
<table>
<thead>
<tr>
<th style="text-align:left">类</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Boolean.html">Boolean</a></td>
<td style="text-align:left">Boolean类在基础中包装基本类型 <code>boolean</code>的值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Byte.html">Byte</a></td>
<td style="text-align:left"><code>Byte</code>类在对象中包装基本类型 <code>byte</code>的值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Character.html">Character</a></td>
<td style="text-align:left"><code>Character</code>类在对象中包装基本类型 <code>char</code>的值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Character.Subset.html">Character.Subset</a></td>
<td style="text-align:left">此类的实例表示Unicode字符集的特定子集。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Character.UnicodeBlock.html">Character.UnicodeBlock</a></td>
<td style="text-align:left">一系列字符子集，表示Unicode规范中的字符块。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Class.html">Class</a><T></td>
<td style="text-align:left">类 <code>类</code>实例表示正在运行的Java应用程序中的类和接口。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ClassLoader.html">ClassLoader</a></td>
<td style="text-align:left">类加载器是一个负责加载类的对象。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ClassValue.html">ClassValue</a><T></td>
<td style="text-align:left">懒惰地将计算值与（可能）每种类型相关联。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Compiler.html">Compiler</a></td>
<td style="text-align:left">Deprecated, for removal: This API element is subject to removal in a future version.JIT compilers and their technologies vary too widely to be controlled effectively by a standardized interface.</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Double.html">Double</a></td>
<td style="text-align:left"><code>Double</code>类在对象中包装基本类型 <code>double</code>的值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Enum.html">Enum</a>&lt;E extends <a href="https://www.apiref.com/java11-zh/java.base/java/lang/Enum.html">Enum</a><E>&gt;</td>
<td style="text-align:left">这是所有Java语言枚举类型的公共基类。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Float.html">Float</a></td>
<td style="text-align:left"><code>Float</code>类在对象中包装基本类型 <code>float</code>的值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/InheritableThreadLocal.html">InheritableThreadLocal</a><T></td>
<td style="text-align:left">此类扩展 <code>ThreadLocal</code>以提供从父线程到子线程的值的继承：当创建子线程时，子级接收父级具有值的所有可继承线程局部变量的初始值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Integer.html">Integer</a></td>
<td style="text-align:left"><code>Integer</code>类在对象中包装基本类型 <code>int</code>的值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Long.html">Long</a></td>
<td style="text-align:left"><code>Long</code>类在对象中包装基本类型 <code>long</code>的值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Math.html">Math</a></td>
<td style="text-align:left">类 <code>Math</code>包含用于执行基本数字运算的方法，例如基本指数，对数，平方根和三角函数。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Module.html">Module</a></td>
<td style="text-align:left">表示运行时模块， <a href="https://www.apiref.com/java11-zh/java.base/java/lang/Module.html#isNamed()"><code>named</code></a>或未命名。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ModuleLayer.html">ModuleLayer</a></td>
<td style="text-align:left">Java虚拟机中的一层模块。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ModuleLayer.Controller.html">ModuleLayer.Controller</a></td>
<td style="text-align:left">控制模块层。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Number.html">Number</a></td>
<td style="text-align:left">抽象类 <code>Number</code>是表示数字值可转换为基本数据类型平台类的超类 <code>byte</code> ， <code>double</code> ， <code>float</code> ， <code>int</code> ， <code>long</code> ，和 <code>short</code> 。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Object.html">Object</a></td>
<td style="text-align:left">类 <code>Object</code>是类层次结构的根。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Package.html">Package</a></td>
<td style="text-align:left">表示与类加载器关联的运行时包的元数据。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Process.html">Process</a></td>
<td style="text-align:left"><code>Process</code>提供对ProcessBuilder.start和Runtime.exec启动的本机进程的控制。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ProcessBuilder.html">ProcessBuilder</a></td>
<td style="text-align:left">此类用于创建操作系统进程。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ProcessBuilder.Redirect.html">ProcessBuilder.Redirect</a></td>
<td style="text-align:left">表示子进程输入的源或子进程输出的目标。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Runtime.html">Runtime</a></td>
<td style="text-align:left">每个Java应用程序都有一个 <code>Runtime</code>类的实例，它允许应用程序与运行应用程序的环境进行交互。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Runtime.Version.html">Runtime.Version</a></td>
<td style="text-align:left">用于Java SE平台实现的版本字符串的表示。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/RuntimePermission.html">RuntimePermission</a></td>
<td style="text-align:left">此类用于运行时权限。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/SecurityManager.html">SecurityManager</a></td>
<td style="text-align:left">安全管理器是一个允许应用程序实现安全策略的类。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Short.html">Short</a></td>
<td style="text-align:left"><code>Short</code>类在对象中包装基本类型 <code>short</code>的值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StackTraceElement.html">StackTraceElement</a></td>
<td style="text-align:left">堆栈跟踪中的元素，由 <a href="https://www.apiref.com/java11-zh/java.base/java/lang/Throwable.html#getStackTrace()"><code>Throwable.getStackTrace()</code></a>返回。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StackWalker.html">StackWalker</a></td>
<td style="text-align:left">堆栈助行器。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StrictMath.html">StrictMath</a></td>
<td style="text-align:left">类 <code>StrictMath</code>包含用于执行基本数字运算的方法，例如基本指数，对数，平方根和三角函数。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/String.html">String</a></td>
<td style="text-align:left"><code>String</code>类表示字符串。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StringBuffer.html">StringBuffer</a></td>
<td style="text-align:left">线程安全，可变的字符序列。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StringBuilder.html">StringBuilder</a></td>
<td style="text-align:left">一个可变的字符序列。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/System.html">System</a></td>
<td style="text-align:left"><code>System</code>类包含几个有用的类字段和方法。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/System.LoggerFinder.html">System.LoggerFinder</a></td>
<td style="text-align:left"><code>LoggerFinder</code>服务负责为其使用的基础框架创建，管理和配置记录器。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Thread.html">Thread</a></td>
<td style="text-align:left"><em>线程</em>是程序中执行的线程。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ThreadGroup.html">ThreadGroup</a></td>
<td style="text-align:left">线程组表示一组线程。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ThreadLocal.html">ThreadLocal</a><T></td>
<td style="text-align:left">该类提供线程局部变量。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Throwable.html">Throwable</a></td>
<td style="text-align:left"><code>Throwable</code>类是Java语言中所有错误和异常的超类。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Void.html">Void</a></td>
<td style="text-align:left"><code>Void</code>类是一个不可实例化的占位符类，用于保存对表示Java关键字void的 <code>类</code>对象的引用。</td>
</tr>
</tbody>
</table>
<h3 id="枚举">枚举👺😺🙌👥</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Enum</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Character.UnicodeScript.html">Character.UnicodeScript</a></td>
<td style="text-align:left">一系列字符子集，表示 <a href="https://www.unicode.org/reports/tr24/"><em>Unicode Standard Annex #24: Script Names</em>中</a>定义的字符脚本。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ProcessBuilder.Redirect.Type.html">ProcessBuilder.Redirect.Type</a></td>
<td style="text-align:left">型号<a href="https://www.apiref.com/java11-zh/java.base/java/lang/ProcessBuilder.Redirect.html"><code>ProcessBuilder.Redirect</code></a> 。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StackWalker.Option.html">StackWalker.Option</a></td>
<td style="text-align:left">堆栈沃克选项来配置<a href="https://www.apiref.com/java11-zh/java.base/java/lang/StackWalker.StackFrame.html">stack frame</a>通过获得的信息<code>StackWalker</code> 。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/System.Logger.Level.html">System.Logger.Level</a></td>
<td style="text-align:left">系统<a href="https://www.apiref.com/java11-zh/java.base/java/lang/System.Logger.html">loggers</a>级别。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Thread.State.html">Thread.State</a></td>
<td style="text-align:left">线程状态。</td>
</tr>
</tbody>
</table>
<h3 id="异常">异常👻👻👾👽</h3>
<table>
<thead>
<tr>
<th style="text-align:left">异常</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">[ArithmeticException]</td>
<td style="text-align:left">发生异常算术条件时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</a></td>
<td style="text-align:left">抛出以指示已使用非法索引访问数组。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ArrayStoreException.html">ArrayStoreException</a></td>
<td style="text-align:left">抛出此异常表示已尝试将错误类型的对象存储到对象数组中。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ClassCastException.html">ClassCastException</a></td>
<td style="text-align:left">抛出以指示代码已尝试将对象强制转换为不是实例的子类。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ClassNotFoundException.html">ClassNotFoundException</a></td>
<td style="text-align:left">的：当应用程序试图加载在通过其字符串名称使用类抛出 <code>forName</code>在类方法 <code>类</code> 。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/CloneNotSupportedException.html">CloneNotSupportedException</a></td>
<td style="text-align:left">抛出此异常表示已调用类 <code>Object</code>中的 <code>clone</code>方法来克隆对象，但该对象的类未实现 <code>Cloneable</code>接口。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/EnumConstantNotPresentException.html">EnumConstantNotPresentException</a></td>
<td style="text-align:left">当应用程序尝试按名称访问枚举常量并且枚举类型不包含具有指定名称的常量时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Exception.html">异常</a></td>
<td style="text-align:left">类 <code>异常</code>及其子类是 <code>Throwable</code>一种形式，表示合理的应用程序可能想要捕获的条件。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IllegalAccessException.html">IllegalAccessException</a></td>
<td style="text-align:left">当应用程序尝试反射创建实例（数组除外），设置或获取字段或调用方法时，抛出IllegalAccessException，但当前正在执行的方法无法访问指定类的字段，方法或构造函数。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IllegalArgumentException.html">IllegalArgumentException</a></td>
<td style="text-align:left">抛出以指示方法已被传递非法或不适当的参数。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IllegalCallerException.html">IllegalCallerException</a></td>
<td style="text-align:left">抛出以指示方法已由不适当的调用方调用。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IllegalMonitorStateException.html">IllegalMonitorStateException</a></td>
<td style="text-align:left">抛出此异常表示线程已尝试在对象的监视器上等待，或者在没有指定监视器的情况下通知在对象监视器上等待的其他线程。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IllegalStateException.html">IllegalStateException</a></td>
<td style="text-align:left">表示在非法或不适当的时间调用了方法。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IllegalThreadStateException.html">IllegalThreadStateException</a></td>
<td style="text-align:left">抛出以指示线程未处于所请求操作的适当状态。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td>
<td style="text-align:left">抛出以指示某种索引（例如数组，字符串或向量）超出范围。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/InstantiationException.html">InstantiationException</a></td>
<td style="text-align:left">当应用程序尝试使用类 <code>类</code>的 <code>newInstance</code>方法创建类的实例时抛出，但无法实例化指定的类对象。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/InterruptedException.html">InterruptedException</a></td>
<td style="text-align:left">线程在等待，休眠或以其他方式占用时抛出，并且线程在活动之前或期间被中断。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/LayerInstantiationException.html">LayerInstantiationException</a></td>
<td style="text-align:left">创建<a href="https://www.apiref.com/java11-zh/java.base/java/lang/ModuleLayer.html">module layer</a>失败时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/NegativeArraySizeException.html">NegativeArraySizeException</a></td>
<td style="text-align:left">如果应用程序尝试创建负大小的数组，则抛出该异常。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/NoSuchFieldException.html">NoSuchFieldException</a></td>
<td style="text-align:left">表示该类没有指定名称的字段。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/NoSuchMethodException.html">NoSuchMethodException</a></td>
<td style="text-align:left">无法找到特定方法时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/NullPointerException.html">NullPointerException</a></td>
<td style="text-align:left">当应用程序在需要对象的情况下尝试使用 <code>null</code>时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/NumberFormatException.html">NumberFormatException</a></td>
<td style="text-align:left">抛出以指示应用程序已尝试将字符串转换为其中一种数字类型，但该字符串没有适当的格式。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ReflectiveOperationException.html">ReflectiveOperationException</a></td>
<td style="text-align:left">核心反射中反射操作抛出的常见超类异常。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/RuntimeException.html">RuntimeException</a></td>
<td style="text-align:left"><code>RuntimeException</code>是在Java虚拟机的正常操作期间可以抛出的那些异常的超类。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/SecurityException.html">SecurityException</a></td>
<td style="text-align:left">由安全管理器抛出以指示安全违规。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td>
<td style="text-align:left">抛出 <code>String</code>方法以指示索引是负数还是大于字符串的大小。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/TypeNotPresentException.html">TypeNotPresentException</a></td>
<td style="text-align:left">当应用程序尝试使用表示类型名称的字符串访问类型时抛出，但不能找到具有指定名称的类型的定义。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/UnsupportedOperationException.html">UnsupportedOperationException</a></td>
<td style="text-align:left">抛出以指示不支持所请求的操作。</td>
</tr>
</tbody>
</table>
<h3 id="错误️">错误💀💀💀☠️</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Error</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/AbstractMethodError.html">AbstractMethodError</a></td>
<td style="text-align:left">应用程序尝试调用抽象方法时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/AssertionError.html">AssertionError</a></td>
<td style="text-align:left">抛出表示断言失败。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/BootstrapMethodError.html">BootstrapMethodError</a></td>
<td style="text-align:left">抛出以指示<code>invokedynamic</code>指令或动态常量未能解析其引导方法和参数，或者对于<code>invokedynamic</code>指令，引导方法未能提供<a href="https://www.apiref.com/java11-zh/java.base/java/lang/invoke/CallSite.html">call site</a>与<a href="https://www.apiref.com/java11-zh/java.base/java/lang/invoke/CallSite.html#getTarget()">target</a>的正确<a href="https://www.apiref.com/java11-zh/java.base/java/lang/invoke/MethodHandle.html#type()">method type</a> ，或者对于动态常量，引导方法具有无法提供所需类型的常量值。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ClassCircularityError.html">ClassCircularityError</a></td>
<td style="text-align:left">当Java虚拟机检测到正在加载的类的超类层次结构中的循环时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ClassFormatError.html">ClassFormatError</a></td>
<td style="text-align:left">当Java虚拟机尝试读取类文件并确定文件格式错误或无法解释为类文件时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Error.html">Error</a></td>
<td style="text-align:left">一个 <code>Error</code>是的子类 <code>Throwable</code> ，表示严重的问题，合理的应用程序不应该试图捕获。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ExceptionInInitializerError.html">ExceptionInInitializerError</a></td>
<td style="text-align:left">表示静态初始化程序中发生意外异常的信号。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IllegalAccessError.html">IllegalAccessError</a></td>
<td style="text-align:left">如果应用程序尝试访问或修改字段，或调用其无权访问的方法，则抛出该异常。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/IncompatibleClassChangeError.html">IncompatibleClassChangeError</a></td>
<td style="text-align:left">在某些类定义发生不兼容的类更改时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/InstantiationError.html">InstantiationError</a></td>
<td style="text-align:left">当应用程序尝试使用Java <code>new</code>构造实例化抽象类或接口时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/InternalError.html">InternalError</a></td>
<td style="text-align:left">抛出此异常表示Java虚拟机中发生了一些意外的内部错误。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/LinkageError.html">LinkageError</a></td>
<td style="text-align:left">子类<code>LinkageError</code>表示某个类对另一个类有一些依赖性; 然而，后一类在前一类的编译后发生了不相同的变化。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/NoClassDefFoundError.html">NoClassDefFoundError</a></td>
<td style="text-align:left">如果Java虚拟机或 <code>ClassLoader</code>实例尝试加载类的定义（作为普通方法调用的一部分或作为使用 <code>new</code>表达式创建新实例的 <code>new</code> ），则 <code>new</code>该类，并且无法找到该类的定义。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/NoSuchFieldError.html">NoSuchFieldError</a></td>
<td style="text-align:left">如果应用程序尝试访问或修改对象的指定字段，并且该对象不再具有该字段，则抛出该异常。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/NoSuchMethodError.html">NoSuchMethodError</a></td>
<td style="text-align:left">如果应用程序尝试调用类的指定方法（静态或实例），并且该类不再具有该方法的定义，则抛出该异常。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/OutOfMemoryError.html">OutOfMemoryError</a></td>
<td style="text-align:left">当Java虚拟机由于内存不足而无法分配对象时抛出，垃圾收集器不再提供更多内存。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/StackOverflowError.html">StackOverflowError</a></td>
<td style="text-align:left">在发生堆栈溢出时抛出，因为应用程序过于严重。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/ThreadDeath.html">ThreadDeath</a></td>
<td style="text-align:left">当调用（不推荐使用） <a href="https://www.apiref.com/java11-zh/java.base/java/lang/Thread.html#stop()"><code>Thread.stop()</code></a>方法时，受害者线程中会抛出 <code>ThreadDeath</code>的实例。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/UnknownError.html">UnknownError</a></td>
<td style="text-align:left">在Java虚拟机中发生未知但严重的异常时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/UnsatisfiedLinkError.html">UnsatisfiedLinkError</a></td>
<td style="text-align:left">如果Java虚拟机无法找到声明为 <code>native</code>的方法的相应本机语言定义，则抛出此异常。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/UnsupportedClassVersionError.html">UnsupportedClassVersionError</a></td>
<td style="text-align:left">当Java虚拟机尝试读取类文件并确定不支持文件中的主要版本号和次要版本号时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/VerifyError.html">VerifyError</a></td>
<td style="text-align:left">当“验证程序”检测到类文件虽然格式正确但包含某种内部不一致或安全问题时抛出。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/VirtualMachineError.html">VirtualMachineError</a></td>
<td style="text-align:left">抛出此异常表示Java虚拟机已损坏或已耗尽其继续运行所需的资源。</td>
</tr>
</tbody>
</table>
<h3 id="注解">注解</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Annotation Type</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Deprecated.html">Deprecated</a></td>
<td style="text-align:left">注释 <code>@Deprecated</code>的程序元素是程序员不鼓励使用的程序元素。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/FunctionalInterface.html">FunctionalInterface</a></td>
<td style="text-align:left">一种信息性注释类型，用于指示接口类型声明旨在成为Java语言规范定义的 <em>功能接口</em> 。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/Override.html">Override</a></td>
<td style="text-align:left">指示方法声明旨在覆盖超类型中的方法声明。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/SafeVarargs.html">SafeVarargs</a></td>
<td style="text-align:left">程序员断言，带注释的方法或构造函数的主体不会对其varargs参数执行可能不安全的操作。</td>
</tr>
<tr>
<td style="text-align:left"><a href="https://www.apiref.com/java11-zh/java.base/java/lang/SuppressWarnings.html">SuppressWarnings</a></td>
<td style="text-align:left">指示应在带注释的元素（以及带注释的元素中包含的所有程序元素中）中抑制指定的编译器警告。</td>
</tr>
</tbody>
</table>

        </div>
        <!-- Share to Twitter, Weibo, Telegram -->
        <div class="flex items-center">
          <div class="mr-4 flex items-center">
            <i class="ri-share-forward-line text-gray-500"></i>
          </div>
          <div class="px-4 cursor-pointer text-blue-500 hover:bg-blue-100 dark:hover:bg-gray-600 inline-flex" @click="shareToTwitter">
            <i class="ri-twitter-line"></i>
          </div>
          <div class="px-4 cursor-pointer text-red-500 hover:bg-red-100 dark:hover:bg-gray-600 inline-flex" @click="shareToWeibo">
            <i class="ri-weibo-line"></i>
          </div>
          <div class="px-4 cursor-pointer text-indigo-500 hover:bg-indigo-100 dark:hover:bg-gray-600 inline-flex" @click="shareToTelegram">
            <i class="ri-telegram-line"></i>
          </div>
        </div>
      </div>

      
        
          <div id="gitalk-container"></div>
        

        
      

      
        <div id="vlaine-comment"></div>
      

      <footer class="py-12 text-center px-4 md:px-0" v-pre>
  Powered by <a href="https://github.com/getgridea/gridea" target="_blank">Gridea</a>  Made by  <a href="https://github.com/JoyZgq" target="_blank">zgq</a> 🎈❤❤❤🌹
</footer>
    </div>

    <!-- TOC Container -->
    <div class="fixed right-0 bottom-0 mb-16 mr-4 shadow w-8 h-8 rounded-full flex justify-center items-center z-10 cursor-pointer bg-white dark:bg-gray-500 dark:text-gray-200 hover:shadow-lg transition-all animated fadeInRight" @click="showToc = true">
      <i class="ri-file-list-line"></i>
    </div>

    <div class="fixed right-0 top-0 bottom-0 overflow-y-auto w-64 bg-white dark:bg-gray-800 p-4 border-l border-gray-100 dark:border-gray-600 z-10 transition-fast" :class="{ '-mr-64': !showToc }">
      <div class="flex mb-4 justify-end">
        <div class="w-8 h-8 inline-flex justify-center items-center rounded-full cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600 transition-fast" @click="showToc = false">
          <i class="ri-close-line text-lg"></i>
        </div>
      </div>
      <div class="post-toc-container">
        <ul class="markdownIt-TOC">
<li>
<ul>
<li>
<ul>
<li><a href="#%E6%8E%A5%E5%8F%A3">接口🦅🦉🦇🐺</a></li>
<li><a href="#%E7%B1%BB%E6%91%98%E8%A6%81">类摘要🦁🙊🦆🐝</a></li>
<li><a href="#%E6%9E%9A%E4%B8%BE">枚举👺😺🙌👥</a></li>
<li><a href="#%E5%BC%82%E5%B8%B8">异常👻👻👾👽</a></li>
<li><a href="#%E9%94%99%E8%AF%AF%EF%B8%8F">错误💀💀💀☠️</a></li>
<li><a href="#%E6%B3%A8%E8%A7%A3">注解</a></li>
</ul>
</li>
</ul>
</li>
</ul>

      </div>
    </div>

    <!-- Back to top -->
    <div class="fixed right-0 bottom-0 mb-4 mr-4 shadow w-8 h-8 rounded-full flex justify-center items-center z-10 cursor-pointer bg-white hover:shadow-lg transition-all dark:bg-gray-500 dark:text-gray-200" @click="backToUp" v-show="scrolled">
      <i class="ri-arrow-up-line"></i>
    </div>
  </div>

  <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
  <!-- Background of PhotoSwipe. 
        It's a separate element as animating opacity is faster than rgba(). -->
  <div class="pswp__bg">
  </div>
  <!-- Slides wrapper with overflow:hidden. -->
  <div class="pswp__scroll-wrap">
    <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
    <div class="pswp__container">
      <div class="pswp__item">
      </div>
      <div class="pswp__item">
      </div>
      <div class="pswp__item">
      </div>
    </div>
    <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
    <div class="pswp__ui pswp__ui--hidden">
      <div class="pswp__top-bar">
        <!--  Controls are self-explanatory. Order can be changed. -->
        <div class="pswp__counter">
        </div>
        <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
        <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
        <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
        <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
        <!-- element will get class pswp__preloader--active when preloader is running -->
        <div class="pswp__preloader">
          <div class="pswp__preloader__icn">
            <div class="pswp__preloader__cut">
              <div class="pswp__preloader__donut">
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
        <div class="pswp__share-tooltip">
        </div>
      </div>
      <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
      </button>
      <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
      </button>
      <div class="pswp__caption">
        <div class="pswp__caption__center">
        </div>
      </div>
    </div>
  </div>
</div>

  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <script src="https://JoyZgq.github.io/media/scripts/main.js"></script>
  
  <!-- Code Highlight -->
  
    <script src="https://JoyZgq.github.io/media/prism.js"></script>
    <script>
      Prism.highlightAll()
    </script>
  

  <script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>
  <script>
    //拿到预览框架，也就是上面的html代码
    var pswpElement = document.querySelectorAll('.pswp')[0];
    //定义图片数组变量
    var imgitems;
    /**
    * 用于显示预览界面
    * @param index 图片数组下标
    */
    function viewImg(index) {
      //其它选项这里不做过多阐述，详情见官网
      var pswpoptions = {
        index: parseInt(index, 10), // 开始幻灯片索引。0是第一张幻灯片。必须是整数，而不是字符串。
        bgOpacity: 0.7, // 背景透明度，0-1
        maxSpreadZoom: 3, // 缩放级别，不要太大
      };
      //初始化并打开PhotoSwipe，pswpElement对应上面预览框架，PhotoSwipeUI_Default为皮肤，imgitems为图片数组，pswpoptions为选项
      var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, imgitems, pswpoptions);
      gallery.init()
    }
    /**
    * 用于添加图片点击事件
    * @param img 图片元素
    * @param index 所属下标（在imgitems中的位置）
    */
    function addImgClick(img, index) {
      img.onclick = function() {
        viewImg(index)
      }
    }
    /**
    * 轮询所有图片，获取src、width、height等数据，加入imgitems，并给图片元素添加事件
    * 最好在onload中执行该方法，本站因放在最底部，所以直接初始化
    * 异步加载图片可在图片元素创建完成后调用此方法
    */
    function initImg() {
      //重置图片数组
      imgitems = [];
      //查找class:markdown 下的所有img元素并遍历
      var imgs = document.querySelectorAll('.markdown img');
      for (var i = 0; i < imgs.length; i++) {
        var img = imgs[i];
        //本站相册初始为loading图片，真实图片放在data-src
        var ds = img.getAttribute("data-src");
        //创建image对象，用于获取图片宽高
        var imgtemp = new Image();
        //判断是否存在data-src
        if (ds != null && ds.length > 0) {
          imgtemp.src = ds
        } else {
          imgtemp.src = img.src
        }
        //判断是否存在缓存
        if (imgtemp.complete) {
          var imgobj = {
            "src": imgtemp.src,
            "w": imgtemp.width,
            "h": imgtemp.height,
          };
          imgitems[i] = imgobj;
          addImgClick(img, i);
        } else {
          console.log('进来了2')
          imgtemp.index = i;
          imgtemp.img = img;
          imgtemp.onload = function() {
            var imgobj = {
              "src": this.src,
              "w": this.width,
              "h": this.height,
            };
            //不要使用push，因为onload前后顺序会不同
            imgitems[this.index] = imgobj
            //添加点击事件
            addImgClick(this.img, this.index);
          }
        }
      }
    }
    //初始化
    initImg();
  </script>
  
    <script type="application/javascript" src="https://unpkg.com/valine"></script>
<script type="application/javascript">
  new Valine({
    el: '#vlaine-comment',
    appId: 'Sy2gsMvGcPQl3gTGsqqYsHW6-gzGzoHsz',
    appKey: 'IpsgegiMUNgRg7l5BVXk6EXM',
    pageSize: 10,
    notify: false,
    avatar: 'mp',
    verify: true,
    placeholder: '客官来都来了，不妨评论一下🌹🐱‍👤',
    visitor: true,
    highlight: false,
    recordIP: true,
  })
</script>
  
  
    
      <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script type="application/javascript" src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>

<script type="application/javascript">

  var gitalk = new Gitalk({
    clientID: '83da62f594c23db993f3',
    clientSecret: '9aa795ad06ecb4133721f1acf047ecb1e4f295e8',
    repo: 'GitalkApp',
    owner: 'JoyZgq',
    admin: ['JoyZgq'],
    id: (location.pathname).substring(0, 49),      // Ensure uniqueness and length less than 50
    distractionFreeMode: false  // Facebook-like distraction free mode
  })

  gitalk.render('gitalk-container')

</script>

    
  
</body>

</html>